package com.fwmagic.rpc;

import com.fwmagic.rpc.proxy.RpcClientProxy;
import com.fwmagic.rpc.service.pojo.User;
import com.fwmagic.rpc.service.service.IUserService;

public class ClientApp {

    public static void main(String[] args) {

        //创建代理对象
        RpcClientProxy clientProxy = new RpcClientProxy();
        //动态代理
        IUserService userService = clientProxy.clientProxy(IUserService.class, "127.0.0.1", 9999);
        //调用目标方法
        User user = userService.findUserById(1);
        //打印
        System.out.println(user);

    }

}